/* 元素周期表横屏样式 */
.periodic-table-container {
  width: 100vw;
  height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.header {
  padding: 30rpx 40rpx;
  background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
  color: white;
  text-align: center;
  box-shadow: 0 4rpx 12rpx rgba(0, 0, 0, 0.1);
  
  .title {
    font-size: 42rpx;
    font-weight: bold;
    display: block;
    margin-bottom: 10rpx;
  }
  
  .subtitle {
    font-size: 28rpx;
    opacity: 0.9;
  }
}

.periodic-grid {
  flex: 1;
  overflow: hidden;
  background: #fff;
  margin: 20rpx;
  border-radius: 20rpx;
  box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.1);
}

.table-wrapper {
  width: 2000rpx;
  height: 1400rpx;
  padding: 30rpx;
}

.periodic-table {
  display: grid;
  grid-template-columns: repeat(18, 1fr);
  grid-template-rows: repeat(10, 1fr);
  gap: 3rpx;
  width: 100%;
  height: 100%;
  padding: 10rpx;
}

.element {
  background: #fff;
  border: 2rpx solid #e0e0e0;
  border-radius: 12rpx;
  padding: 12rpx;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
  
  &::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s;
  }
  
  &:hover::before {
    transform: translateX(100%);
  }
  
  &:active, &.selected {
    transform: scale(1.15) translateZ(0);
    box-shadow: 0 8rpx 24rpx rgba(0, 0, 0, 0.2);
    border-color: #007AFF;
    z-index: 10;
  }
  
  .atomic-number {
    font-size: 22rpx;
    color: #666;
    font-weight: 500;
  }
  
  .symbol {
    font-size: 36rpx;
    font-weight: bold;
    color: #333;
    margin: 6rpx 0;
    font-family: 'Arial', sans-serif;
  }
  
  .name {
    font-size: 22rpx;
    color: #666;
    text-align: center;
    line-height: 1.3;
    font-weight: 500;
  }
  
  .atomic-mass {
    font-size: 20rpx;
    color: #999;
    margin-top: 4rpx;
  }
}

// 元素类别样式 - 更丰富的颜色
.nonmetal { 
  background: linear-gradient(135deg, #e8f5e8 0%, #c8e6c9 100%);
  border-color: #81c784;
}

.noble-gas { 
  background: linear-gradient(135deg, #fff3cd 0%, #ffe082 100%);
  border-color: #ffb74d;
}

.alkali-metal { 
  background: linear-gradient(135deg, #f8d7da 0%, #ef9a9a 100%);
  border-color: #e57373;
}

.alkaline-earth { 
  background: linear-gradient(135deg, #fff3cd 0%, #ffcc80 100%);
  border-color: #ff9800;
}

.metalloid { 
  background: linear-gradient(135deg, #d4edda 0%, #a5d6a7 100%);
  border-color: #66bb6a;
}

.halogen { 
  background: linear-gradient(135deg, #d1ecf1 0%, #90caf9 100%);
  border-color: #42a5f5;
}

.transition-metal { 
  background: linear-gradient(135deg, #cce5ff 0%, #90caf9 100%);
  border-color: #2196f3;
}

.post-transition { 
  background: linear-gradient(135deg, #e2e3e5 0%, #bdbdbd 100%);
  border-color: #757575;
}

.lanthanide { 
  background: linear-gradient(135deg, #f8d7da 0%, #f48fb1 100%);
  border-color: #ec407a;
}

.actinide { 
  background: linear-gradient(135deg, #f5c6cb 0%, #ce93d8 100%);
  border-color: #ab47bc;
}

.placeholder {
  background: transparent;
  border: none;
  pointer-events: none;
}

.lanthanide-label, .actinide-label {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28rpx;
  font-weight: bold;
  color: #666;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  border: 2rpx solid #dee2e6;
  border-radius: 12rpx;
  
  text {
    text-align: center;
    line-height: 1.4;
  }
}

.footer {
  padding: 30rpx 40rpx;
  background: #fff;
  border-top: 1rpx solid #eee;
  box-shadow: 0 -4rpx 12rpx rgba(0, 0, 0, 0.05);
  
  button {
    width: 100%;
    height: 88rpx;
    border-radius: 44rpx;
    font-size: 36rpx;
    font-weight: bold;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: white;
    
    &:disabled {
      background: #ccc;
      opacity: 0.6;
    }
  }
}

// 响应式适配
@media (max-width: 768rpx) {
  .table-wrapper {
    width: 1600rpx;
    height: 1200rpx;
  }
  
  .element {
    padding: 8rpx;
    
    .symbol {
      font-size: 28rpx;
    }
    
    .name {
      font-size: 18rpx;
    }
    
    .atomic-mass {
      font-size: 16rpx;
    }
  }
}

// 滚动条样式
::-webkit-scrollbar {
  width: 8rpx;
  height: 8rpx;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4rpx;
}

::-webkit-scrollbar-thumb {
  background: #c1c1c1;
  border-radius: 4rpx;
  
  &:hover {
    background: #a8a8a8;
  }
}